# coding:utf-8

import io

f = open('000-test.json', 'w')
print(type(f), f)
print(f.closed)
print(f.mode)
print(f.name)
print(f.encoding)
print(f.buffer)
# <class '_io.TextIOWrapper'> <_io.TextIOWrapper name='000-test.json' mode='w' encoding='UTF-8'>
# False
# w
# 000-test.json
# UTF-8
# <_io.BufferedWriter name='000-test.json'>
f.write("{'name': 'John'}")
f.flush()
f.close()
